home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Snippets / NewHelp 1.0.1 / Read Me < prev   
Encoding:
Text File  |  1995-12-01  |  3.4 KB  |  119 lines  |  [TEXT/ttxt]

  1. NewHelp-c.sit.hqx - Think C 7
  2. -----------------
  3.  
  4. This is an itty bitty bytes(tm) rendition of the 1989 help demo
  5. by R. Fronabarger.  Translated from Pascal and mucked about by
  6. Kenneth A. Long, somewhere between then and 1 December 1995.
  7.  
  8. It was free and still is.
  9.  
  10. Neither demo checked, or checks, for color, though they use some
  11. color 'styl' resources.
  12.  
  13. The content of THIS help demo is the CTools(tm) help bank of data.
  14. I got this thing done for that purpose, so I thought I'd let y'all
  15. have the C version (I revived the Pascal one and posted to a.s.m.
  16. last year).
  17.  
  18. Be forwarned!  It has bugs!  If you fix them, PLEASE post an update.
  19. Nothing serious, though.  Seems to exit on it's own, sometimes.  I
  20. had trouble with the 'CNTL' resourse, so replaced it with NewControl.
  21. I also had trouble with the modal handlings, so the bugs are in there.
  22.  
  23. ALL other help modules I looked at were too complicated.  Let's do
  24. our programming toward simpility!  Okay?
  25.  
  26. Off my soap box, I composed the help content in ClarisWorks, then
  27. copy/paste between it and ResEdit.  If you make new 'TEXT' and 'styl'
  28. resources, this is easy.  Open the new, empty 'TEXT' and NOT the
  29. 'styl' resource and paste into it.  Drag-select something from your 
  30. word processor, copy, click-switch to the 'TEXT' picker in ResEdit,
  31. hit Command K, Command V, Command I, TAB, type in a name for the
  32. resource, Command W, Command W, click-switch back to your WP.
  33.  
  34. If you do Command K in the 'style' resource, instead, the resource
  35. names will go to labelling the 'TEXT' resources and NOT the 'styl'!
  36. So paste styled text into the 'TEXT' resources and the other will be
  37. auto-created WITH labels.
  38.  
  39. The resource names are important because they are what you use to
  40. create the proper 'STR#' resource which is used for the subject list.
  41.  
  42. To do this, open the resource you created containing 'TEXT'/'styl'
  43. resource with ResTools 3.0, using the Decompile menu item.  Then
  44. decompile all the 'TEXT' resources and nothing else.  Save the text
  45. file generated as fileName.r.  Quit ResTools and open the file with
  46. a text editor.  
  47.  
  48. Remove everything in the file except the resource header lines.
  49.  
  50. Example:
  51.  
  52. userdefined resource  'TEXT' (128 , "Header")
  53. userdefined resource  'TEXT' (129 , "Descrpit.")
  54. userdefined resource  'TEXT' (130 , "Data")
  55.  
  56. Replace All instances of:
  57.  
  58. userdefined resource  'TEXT' (
  59.  
  60. with:
  61.  
  62. /*
  63.  
  64. Replace All instances of:
  65.  
  66. ,
  67.  
  68. with:
  69.  
  70. */
  71.  
  72. Then, replace all instances of:
  73.  
  74. ")
  75.  
  76. with:
  77.  
  78. ";
  79.  
  80. Thos will leve you with your string list WITH their ID numbers:
  81.  
  82. /* 128 */ "Header";
  83. /* 129 */ "Descrpit";
  84. /* 130 */ "Data";
  85.  
  86. Quit and reopen the file with ResTools 3.0.  Select 'STR#' from the
  87. Templates menu, at the top of the file:
  88.  
  89. resource 'STR#' (128) {
  90.     "These are Pascal strings";
  91.     "Enter as many as you like";
  92.     "All are preceeded by their length"
  93. };
  94.  
  95. /* 128 */ "Header";
  96. /* 129 */ "Descrpit.";
  97. /* 130 */ "Data";
  98.  
  99. Now, simply make your list fit this template and compile:
  100.  
  101. resource 'STR#' (128) {
  102. /* 128 */ "Header";
  103. /* 129 */ " Descrpit.";
  104. /* 130 */ "  Data"
  105. };
  106.  
  107. The above has been indented to show sub-categories.
  108.  
  109. The 'HLP#' resource is simple.  You just put in the ID, twice,
  110. of each entry in your 'TEXT'/'styl' combo. - one for each set.
  111. Click on the asterisks, hit Command K for as many of them as you
  112. have, put the insertion point in the first one, type the ID, hit
  113. TAB, type it again, hit TAB, type the next, hit TAB, etc., etc.
  114.  
  115. Enjoy!
  116.  
  117. -Ken-
  118.  
  119. ---------------------------------------------------------------